#include <stdio.h>
#include <string.h>
struct bit 
{
    unsigned char a:1;
    unsigned char b:3;
    unsigned char c:4;
}

;void printbit(struct bit *m);
int main()
{
    struct bit bit,*p;
    bit.a = 1;
    bit.b = 7;
    bit.c = 15;
    p = &bit;
    printbit(p);

    printf("char = 0x%x\n",*(unsigned char *)(p));
    printf("next char = 0x%x\n",*(unsigned char *)(p+1));

    p -> a += 1;
    p -> b += 2;
    printbit(p);
    
    printf("char = 0x%x\n",*(unsigned char *)(p));
    printf("next char = 0x%x\n",*(unsigned char *)(p+1));

    return 0;
}

void printbit(struct bit *m)
{
    printf("0x%x\n",m -> a);
    printf("0x%x\n",m -> b);
    printf("0x%x\n",m -> c);
}
